package com.xuelang.pipeline.worker.entry.secret;

import com.xuelang.pipeline.worker.app.secret.SecretService;
import com.xuelang.pipeline.worker.client.common.result.ApiResult;
import com.xuelang.pipeline.worker.client.crd.dto.SecretDTO;
import com.xuelang.pipeline.worker.client.secret.ISecretService;
import io.kubernetes.client.openapi.models.V1Secret;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liuyuan.ly
 * @since 2024/9/4 11:25
 */
@RestController
@RequestMapping("/pipeline/worker/")
@Slf4j
public class SecretController implements ISecretService {

    @Autowired
    private SecretService secretService;

    @Override
    public ApiResult<Boolean> saveOrUpdateConfigMap(SecretDTO secretDTO) {
        V1Secret v1Secret = secretService.saveOrUpdateSecret(secretDTO);
        return ApiResult.success(true);
    }
}
